package com.zhouyu.runner;

import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;

/**
 * @author leimingchao
 * create 2025-06-05 23:05
 */
//@Component
public class ZhouyuApplicationRunner implements ApplicationRunner {
	@Override
	public void run(ApplicationArguments args) throws Exception {

		System.out.println("ZhouyuApplicationRunner执行。。。");
		System.out.println("=====================getNonOptionArgs()============================");
		args.getNonOptionArgs().forEach(System.out::println);
		System.out.println("===============getOptionNames()==================");
		for (String sourceArg : args.getOptionNames()) {
			System.out.println(sourceArg);
		}
		System.out.println("==============getOptionValues()================");
		System.out.println(args.getOptionValues("k1"));

		System.out.println("==============getSourceArgs()===================");
		for (String sourceArg : args.getSourceArgs()) {
			System.out.println(sourceArg);
		}
	}
}
